﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _06.FindConnectedComponents
{
    class FindConnectedComponents
    {
        static void Main(string[] args)
        {
            List<int>[] nodes = new List<int>[8];
            nodes[0] = new int[] { 1, 3 }.ToList();
            nodes[1] = new int[] { 0, 2, 3, 4 }.ToList();
            nodes[2] = new int[] { 1, 4 }.ToList();
            nodes[3] = new int[] { 0, 1, 4 }.ToList();
            nodes[4] = new int[] { 1, 2, 3, 5 }.ToList();
            nodes[5] = new int[] { 4 }.ToList();
            nodes[6] = new int[] { 7 }.ToList();
            nodes[7] = new int[] { 6 }.ToList();

            Graph graph = new Graph(nodes);
            graph.FindComponents();
        }
    }
}
